﻿using BCT.Domains;
using BCT.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace BCT.Api.Controllers
{
    public class SkillDetailManController : ApiController
    {
        //bool AddSkillDetail(SkillDetailModel model);
        //DataListModel<SkillDetailModel> GetSkillDetailList(ConditionModel model);
        //string LogDelete(SkillDetailModel model);
        //string ModefyUser(SkillDetailModel model);
        private readonly ISkillDetailManDomain _skillDetailManDomain;
        public SkillDetailManController(SkillDetailManDomain skillDetailManDomain)
        {
            _skillDetailManDomain = skillDetailManDomain;
        }
        [HttpGet,HttpPost]
        public Response GetSkillDetailList(ConditionModel model)
        {
            var skillDetaillist = _skillDetailManDomain.GetSkillDetailList(model);
            return new Response() { data = skillDetaillist.Data, count = skillDetaillist.Count };
        }

        public Response ModefySkillDetail(SkillDetailModel model)
        {
            var skillDetail = _skillDetailManDomain.ModefySkillDetail(model);
            if (skillDetail == "修改成功！")
            {
                return new Response() { data = skillDetail };
            }
            else
            {
                return new Response() { data = skillDetail, msg = "false" };
            }
        }

        public Response AddSkillDetail(SkillDetailModel model)
        {
            var skillDetail = _skillDetailManDomain.AddSkillDetail(model);
            return new Response() { data = skillDetail };
        }

        public Response LogDelete(SkillDetailModel model)
        {
            var skillDetail = _skillDetailManDomain.LogDelete(model);
            return new Response() { data = skillDetail };
        }
    }
}
